home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 April / macformat-023.iso / Shareware City / Developers / RLaB / rlib / finite.r < prev    next >
Encoding:
Text File  |  1994-10-09  |  439 b   |  19 lines  |  [TEXT/RLAB]

  1. //----------------------------------------------------------------------
  2. //
  3. // finite
  4. //
  5. // Syntax: a=finite(b)
  6. //
  7. // This routines returns a matrix containing a 1 if the corresponding
  8. // element is finite (i.e., not Inf or NaN) and a 0 if it is either
  9. // Inf or NaN.
  10. //
  11. // Original Author: Jeff Layton 
  12.  
  13. //----------------------------------------------------------------------
  14.  
  15. finite = function(b)
  16. {
  17.   return !(isinf (b) + isnan (b))
  18. };
  19.